<template>
  <div>
    <el-container>
      <el-header>
        <div class="q1 el-icon-s-fold" @click="flag=!flag"></div>
        <el-button type="primary" class="q2" @click="tui">退出登录</el-button>
      </el-header>
      <el-container>
        <el-aside width="200px">
              <el-menu
            :collapse="flag"
      default-active="2"
      router
      class="el-menu-vertical-demo"
      @open="handleOpen"    
      @close="handleClose">
    <el-menu-item index="/xue">
        <i class="el-icon-location"></i>
        <span slot="title">学生管理</span>
      </el-menu-item>
      <el-menu-item index="/shang">
        <i class="el-icon-menu"></i>
        <span slot="title">商品管理</span>
      </el-menu-item>
      <el-menu-item index="/ding">
        <i class="el-icon-document"></i>
        <span slot="title">订单管理</span>
      </el-menu-item>
      <el-menu-item index="/zhi">
        <i class="el-icon-setting"></i>
        <span slot="title">支付管理</span>
      </el-menu-item>
    </el-menu>
        </el-aside>
        <el-main><router-view></router-view></el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {
        flag:false,
    };
  },
  methods: {
    tui() {
      localStorage.removeItem("token");
      this.$router.push({ path: "/login" });
    },
  },
};
</script>
<style  scoped>
.el-header,
.el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  color: #333;
  text-align: center;
  line-height: 200px;
}


body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.q1 {
  width: 30px;
  height: 30px;
  margin-top: 16px;
  margin-left: 220px;
  font-size:28px;
  text-align: center;
  line-height: 30px;
  float: left;
  color:#fff;
}
.q2 {
  float: right;
  margin-top: 12px;
  margin-right: 5px;
}
</style>